/*
 * @Description:
 * @Author: 崔堂袁
 * @Date: 2021-04-23 23:08:04
 * @LastEditTime: 2021-05-05 13:41:43
 */
// node后端服务器
const http = require('http')
const bodyParser = require('body-parser')
const express = require('express')
const userApi = require('./api/userApi')

const app = express()
app.use(bodyParser.json({ limit: '10mb' })) // for parsing application/json
app.use(bodyParser.urlencoded({ limit: '10mb', extended: true })) // for parsing application/x-www-form-urlencoded
const server = http.createServer(app)

// 后端api路由
app.use('/api/user', userApi)

// 启动监听
server.listen(3000, () => {
  console.log(' success!! port:3000')
})
